<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>

        class Flower {

            constructor(name) {
                this.name = name;
            }

            sayHello(name) {
                console.log(this.name + "说,你好啊" + name);
            }

        }

        let f1 = new Flower("康乃馨");
        f1.sayHello("大顺");

        //薰衣草类
        class Lanvender extends Flower {
            constructor(name) {
                super(name);
            }
        }

        let f2 = new Lanvender("蓝色妖姬");
        f2.sayHello("大顺");

    </script>
</body>

</html>